const Controller = require('egg').Controller

class LearningController extends Controller {
  async getLearningRecord() {
    const {ctx} = this
    let learningList = await ctx.service.learningRecord.getLearningRecord()
    if(learningList) {
      ctx.body = {
        code: 20000,
        data: learningList
      }
    }else{
      ctx.body = {
        code: 50000,
        data: "服务器异常"
      }
    }
  }
}

module.exports = LearningController